<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<title>集群统计 | Elasticsearch: 权威指南 | Elastic</title>
    <!-- Give IE8 a fighting chance -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
	<link rel="stylesheet" type="text/css" href="../static/styles.css" />
</head>
<body>
<div class="main-container">
    <section id="content">
        
        <div class="content-wrapper">
            <section id="guide" lang="zh_cn">
                <div class="container">
                    <div class="row">
                        <div class="col-xs-12 col-sm-8 col-md-8 guide-section">
                            <div style="color:gray; word-break: break-all; font-size:12px;">原文地址: <a href="https://www.elastic.co/guide/cn/elasticsearch/guide/current/_cluster_stats.html" rel="nofollow">https://www.elastic.co/guide/cn/elasticsearch/guide/current/_cluster_stats.html</a>, 版权归 www.elastic.co 所有<br/>
                            英文版地址: <a href="https://www.elastic.co/guide/en/elasticsearch/guide/current/_cluster_stats.html" rel="nofollow">https://www.elastic.co/guide/en/elasticsearch/guide/current/_cluster_stats.html</a>
                            </div>
                        <!-- start body -->
                  <div class="page_header">
<b>请注意:</b><br>本书基于 Elasticsearch 2.x 版本，有些内容可能已经过时。
</div>
<div id="content">
<div class="breadcrumbs">
<span class="breadcrumb-link"><a href="index.html">Elasticsearch: 权威指南</a></span>
»
<span class="breadcrumb-link"><a href="administration.html">管理、监控和部署</a></span>
»
<span class="breadcrumb-link"><a href="cluster-admin.html">监控</a></span>
»
<span class="breadcrumb-node">集群统计</span>
</div>
<div class="navheader">
<span class="prev">
<a href="_monitoring_individual_nodes.html">« 监控单个节点</a>
</span>
<span class="next">
<a href="_index_stats.html">索引统计 »</a>
</span>
</div>
<div class="section">
<div class="titlepage"><div><div>
<h2 class="title">
<a id="_cluster_stats"></a>集群统计 (Cluster Stats)<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elasticsearch-cn/elasticsearch-definitive-guide/edit/cn/500_Cluster_Admin/40_other_stats.asciidoc">edit</a>
</h2>
</div></div></div>
<p><code class="literal">cluster-stats</code> API 提供了和 <code class="literal">node-stats</code> 相似的输出。

但有一个重要的区别：节点统计显示的是每个节点上的统计值，而 <code class="literal">cluster-stats</code> 展示的是所有节点上单个指标的汇总。</p>

<p>这里面提供一些很值得一看的统计值。

比如说你可以看到，整个集群用了 50% 的堆内存，或者说过滤器缓存的淘汰情况不严重。

这个接口主要用途是提供一个快速概览，比<code class="literal">cluster-health</code>更详细、但又没有<code class="literal">node-stats</code>那么详细。

对于非常大的集群来说也很有用，因为那时候 <code class="literal">node-stats</code> 的输出已经非常难于阅读了。</p>

<p>这个 API 可以像下面这样调用：</p>
<div class="pre_wrapper lang-js">
<pre class="programlisting prettyprint lang-js">GET _cluster/stats</pre>
</div>
</div>
<div class="navfooter">
<span class="prev">
<a href="_monitoring_individual_nodes.html">« 监控单个节点</a>
</span>
<span class="next">
<a href="_index_stats.html">索引统计 »</a>
</span>
</div>
</div>

                  <!-- end body -->
                        </div>
                        <div class="col-xs-12 col-sm-4 col-md-4" id="right_col">
                        
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </section>
</div>
<script src="../static/cn.js"></script>
</body>
</html>